var webpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');

var config = require('./webpack.dev.config.js');

//config.entry.unshift('webpack-dev-server/client', 'webpack/hot/dev-server');

var compiler = webpack(config);

var port = 3001;

var server = new webpackDevServer(compiler, {
    inline: true,
    hot: true,
    publicPath: config.output.publicPath,
    disableHostCheck: true,
    stats: {
        colors: true
    },
    //// 代理设置
    // proxy: {
    // 	"/your_project_path/": {
    // 		target: 'http://target.server',
    //         host: 'target.server',
    //         secure: false,
    //         // 设施是否跨域
    //         // 如果false的话，只会代理到同域
    //         changeOrigin: true
    // 	}
    // }
});


server.listen(port, 'localhost', function() {
    console.log('starting server successfuly');
});
